<!DOCTYPE html>
<html>
<head>
    <!-- hexo-inject:begin --><!-- hexo-inject:end --><title>博望</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.css">
    <link href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css">
    <script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    
<link rel="stylesheet" href="/css/prism.css">
 
    
<script src="/js/prism.js"></script>

    
    
<link rel="stylesheet" href="/css/index.css">
 
    
<script src="/js/search.js"></script>



     
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML" async></script>
        <script type="text/x-mathjax-config">
            MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
        </script>
     

     
        <script src="//lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js"> </script>
        
<script src="/js/fancybox.js"></script>

    

    <script type="text/javascript">
        var search_path = "search.xml";
        if (search_path.length == 0) {
            search_path = "search.xml";
        }
        var path = "/" + search_path;
        searchFunc(path, 'local-search-input', 'local-search-result');
    </script>
<!-- hexo injector head_end start -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/themes/prism.css">
<!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.1.0"><!-- hexo-inject:begin --><!-- hexo-inject:end --></head>

    <style>
        .row2 {
            /* --bs-gutter-x: 2.5rem;
            --bs-gutter-y: 0;
            display: flex;
            flex-wrap: wrap;
            margin-top: calc(var(--bs-gutter-y) * -20);
            margin-right: calc(var(--bs-gutter-x) * -2);
            margin-left: calc(var(--bs-gutter-x) * -2); */
        }

        .row-0 {
            width: 0;
        }
    </style>

    <body id="body">
        <!-- hexo-inject:begin --><!-- hexo-inject:end --><!-- 导航栏 -->
        <nav class="navbar navbar-expand-md navbar-dark mb-4 pt-3 pb-3">
    <div class="container" style="display: flex;flex-direction: row;align-items: flex-end;">
        <div style="display: flex;flex-direction: column;">
            <a class="navbar-brand" style='font: bold 29px "Times New Roman", Georgia, Times, sans-serif;
        color: #555;' href="/ ">
                博望
            </a>
            <span style="padding-bottom:7px;padding-right:20px">
                博望不熄
            </span>
        </div>

        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse"
            aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarCollapse">
            <ul class="navbar-nav me-auto mb-2 mb-md-0" style="color: #555;">
                
 
 

    <li class="nav-item">
        <a class="nav-link" style="color: #555;" href="/">
            <i class="fa fa-home "> </i> 主页
        </a>
    </li>

    <li class="nav-item">
        <a class="nav-link" style="color: #555;" href="/archives">
            <i class="fa fa-archive" "> </i> 归档
        </a>
    </li>
 

            </ul>

            
                <form class="d-flex">
                    <button class="btn text-muted fa fa-search d-none d-md-block d-lg-block" disabled></button>
                    <input id="local-search-input" class="form-control me-2 pe-4" type="search"
                        placeholder="搜索 " aria-label="Search">
                </form>
                

                    <ul class="navbar-nav">
                        
 

                    </ul>
        </div>
    </div>
</nav>

            <main class="container">
                <div class="row row2 pt-3">
                    <!-- 文章 -->
                    <div id="content" class="col-md-12">
                        <div class="markdown-section">
                            <!-- 搜索结果 -->
                            <div id="local-search-result"></div>
                            <p class="h2 border-bottom pb-2"><i class="p-1 fa fa-folder-open"></i>
    当前标签 <i class="fa fa-long-arrow-right ps-1 pe-1"></i>
    QuickJS
</p> 

<!-- 主页 -->
 


    <div class="pb-4 tag-hover">
        <p class="tag-hover h2">
            <a href="/2022/05/16/QuickJS%E4%BB%A3%E7%A0%81%E8%A7%A3%E6%9E%90%E9%98%B6%E6%AE%B5%E5%85%B3%E9%94%AE%E7%BB%93%E6%9E%84%E4%BD%93/" class="link-dark text-decoration-none">
                QuickJS 代码解析阶段关键结构体 
            </a>
        </p>

    <div class="pb-0">
        <i class="fa fa-calendar p-1"></i>
        2022/05/16 09:08:10 

        <i class="fa fa-folder-open p-1"> </i> 
        <span class="tag-hover">
             
        </span>

        <i class="fa fa-tag p-1"> </i>
        <span class="tag-hover">
            
                <a href="/tags/QuickJS/" class="link-dark text-decoration-none"> 
                    QuickJS 
                </a>
            
        </span>
    </div>

        <div class="pt-3 pe-4">
            <!-- 如果有摘要则显示摘要，没有就自己截取 -->
            
                代码解析关键数据结构 
             
        </div>
        <div class="p-2 pe-4">
            <a href="/2022/05/16/QuickJS%E4%BB%A3%E7%A0%81%E8%A7%A3%E6%9E%90%E9%98%B6%E6%AE%B5%E5%85%B3%E9%94%AE%E7%BB%93%E6%9E%84%E4%BD%93/" class="btn btn-outline-secondary btn-sm float-end" type="button">
                阅读全文 <i class="fa fa-angle-double-right"></i>
            </a>
        </div>
    </div>

    <div class="pb-4 tag-hover">
        <p class="tag-hover h2">
            <a href="/2022/05/16/QuickJS-JavaScript%E4%B8%96%E7%95%8C%E7%9A%84%E5%8E%9F%E5%A7%8B%E5%8E%9F%E5%9E%8B%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%BB%BA%E7%AB%8B/" class="link-dark text-decoration-none">
                QuickJS JavaScript世界的原始原型对象的建立 
            </a>
        </p>

    <div class="pb-0">
        <i class="fa fa-calendar p-1"></i>
        2022/05/16 09:07:50 

        <i class="fa fa-folder-open p-1"> </i> 
        <span class="tag-hover">
             
        </span>

        <i class="fa fa-tag p-1"> </i>
        <span class="tag-hover">
            
                <a href="/tags/QuickJS/" class="link-dark text-decoration-none"> 
                    QuickJS 
                </a>
            
        </span>
    </div>

        <div class="pt-3 pe-4">
            <!-- 如果有摘要则显示摘要，没有就自己截取 -->
            
                JavaScript中，对象的继承是通过原型链的方式来实现。一个子对象可以从父对象中继承其父对象的属性和方法。具体的机制是：当访问一个对象的属性或方法时，首先会查找该对象是否有对应的属性或方法。如果有，就调用其属性和方法。如果没有，就访问其原型对象，查看原型对象中是否存在。如果存在，就调用该属性或方法。如果没有，继续寻找原型对象的原型对象。直到访问到原始原型对象为止。需要注意的是，所有的对象继承自原始原型对象。 
             
        </div>
        <div class="p-2 pe-4">
            <a href="/2022/05/16/QuickJS-JavaScript%E4%B8%96%E7%95%8C%E7%9A%84%E5%8E%9F%E5%A7%8B%E5%8E%9F%E5%9E%8B%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%BB%BA%E7%AB%8B/" class="btn btn-outline-secondary btn-sm float-end" type="button">
                阅读全文 <i class="fa fa-angle-double-right"></i>
            </a>
        </div>
    </div>

    <div class="pb-4 tag-hover">
        <p class="tag-hover h2">
            <a href="/2022/05/12/QuickJS%E6%95%B0%E5%AD%97%E5%AD%97%E9%9D%A2%E9%87%8F/" class="link-dark text-decoration-none">
                QuickJS数字字面量 
            </a>
        </p>

    <div class="pb-0">
        <i class="fa fa-calendar p-1"></i>
        2022/05/12 22:20:32 

        <i class="fa fa-folder-open p-1"> </i> 
        <span class="tag-hover">
             
        </span>

        <i class="fa fa-tag p-1"> </i>
        <span class="tag-hover">
            
                <a href="/tags/QuickJS/" class="link-dark text-decoration-none"> 
                    QuickJS 
                </a>
            
        </span>
    </div>

        <div class="pt-3 pe-4">
            <!-- 如果有摘要则显示摘要，没有就自己截取 -->
            
                QuickJS将JavaScript代码先当作字符串读入内存。然后逐字节遍历这个字符串，当判断某一个字节的在字符 '0' 和字符 '9' 之间时，认为识别到了数字字面量的起始位置。然后该字符串，转化成数字。 
             
        </div>
        <div class="p-2 pe-4">
            <a href="/2022/05/12/QuickJS%E6%95%B0%E5%AD%97%E5%AD%97%E9%9D%A2%E9%87%8F/" class="btn btn-outline-secondary btn-sm float-end" type="button">
                阅读全文 <i class="fa fa-angle-double-right"></i>
            </a>
        </div>
    </div>

    <div class="pb-4 tag-hover">
        <p class="tag-hover h2">
            <a href="/2022/05/05/QuickJS-JSString-JSAtom/" class="link-dark text-decoration-none">
                QuickJS JSString&JSAtom 
            </a>
        </p>

    <div class="pb-0">
        <i class="fa fa-calendar p-1"></i>
        2022/05/05 21:02:38 

        <i class="fa fa-folder-open p-1"> </i> 
        <span class="tag-hover">
            
                <a href="/categories/QuickJS/ " class="link-dark text-decoration-none"> 
                    QuickJS 
                </a>
             
        </span>

        <i class="fa fa-tag p-1"> </i>
        <span class="tag-hover">
            
                <a href="/tags/QuickJS/" class="link-dark text-decoration-none"> 
                    QuickJS 
                </a>
            
        </span>
    </div>

        <div class="pt-3 pe-4">
            <!-- 如果有摘要则显示摘要，没有就自己截取 -->
            
                QuickJS中，使用JSString结构体封装了字符串变量。使用JSAtom来完成对字符串的存储和比较。QuickJS支持ASCII和Unicode两种字符串编码格式。先看下，它们的定义 
             
        </div>
        <div class="p-2 pe-4">
            <a href="/2022/05/05/QuickJS-JSString-JSAtom/" class="btn btn-outline-secondary btn-sm float-end" type="button">
                阅读全文 <i class="fa fa-angle-double-right"></i>
            </a>
        </div>
    </div>

    <div class="pb-4 tag-hover">
        <p class="tag-hover h2">
            <a href="/2022/05/05/QuickJS%E5%AD%97%E8%8A%82%E7%A0%81%E6%89%93%E5%8D%B0/" class="link-dark text-decoration-none">
                QuickJS字节码打印 
            </a>
        </p>

    <div class="pb-0">
        <i class="fa fa-calendar p-1"></i>
        2022/05/05 10:36:08 

        <i class="fa fa-folder-open p-1"> </i> 
        <span class="tag-hover">
            
                <a href="/categories/QuickJS/ " class="link-dark text-decoration-none"> 
                    QuickJS 
                </a>
             
        </span>

        <i class="fa fa-tag p-1"> </i>
        <span class="tag-hover">
            
                <a href="/tags/QuickJS/" class="link-dark text-decoration-none"> 
                    QuickJS 
                </a>
            
        </span>
    </div>

        <div class="pt-3 pe-4">
            <!-- 如果有摘要则显示摘要，没有就自己截取 -->
            
                QuickJS执行JavaScript代码时，先将源码解析成字节码，然后再执行字节码。字节码由操作码和操作数组成。QuickJS支持字节码的打印。我们只需要开启一个宏定义即可将字节码打印出来。 
             
        </div>
        <div class="p-2 pe-4">
            <a href="/2022/05/05/QuickJS%E5%AD%97%E8%8A%82%E7%A0%81%E6%89%93%E5%8D%B0/" class="btn btn-outline-secondary btn-sm float-end" type="button">
                阅读全文 <i class="fa fa-angle-double-right"></i>
            </a>
        </div>
    </div>

    <div class="pb-4 tag-hover">
        <p class="tag-hover h2">
            <a href="/2022/05/05/QuickJS%E6%93%8D%E4%BD%9C%E7%A0%81/" class="link-dark text-decoration-none">
                QuickJS操作码 
            </a>
        </p>

    <div class="pb-0">
        <i class="fa fa-calendar p-1"></i>
        2022/05/05 10:32:43 

        <i class="fa fa-folder-open p-1"> </i> 
        <span class="tag-hover">
            
                <a href="/categories/QuickJS/ " class="link-dark text-decoration-none"> 
                    QuickJS 
                </a>
             
        </span>

        <i class="fa fa-tag p-1"> </i>
        <span class="tag-hover">
            
                <a href="/tags/QuickJS/" class="link-dark text-decoration-none"> 
                    QuickJS 
                </a>
            
        </span>
    </div>

        <div class="pt-3 pe-4">
            <!-- 如果有摘要则显示摘要，没有就自己截取 -->
            
                操作码有点类似于汇编语言的指令，决定”CPU“执行何种操作。操作数就是操作码将要操作的数据。 
             
        </div>
        <div class="p-2 pe-4">
            <a href="/2022/05/05/QuickJS%E6%93%8D%E4%BD%9C%E7%A0%81/" class="btn btn-outline-secondary btn-sm float-end" type="button">
                阅读全文 <i class="fa fa-angle-double-right"></i>
            </a>
        </div>
    </div>
 

<!--  页码 -->
<nav class="pt-4 border-top mt-4">
    <ul class="pagination justify-content-center new-pagination">
        <span class="page-number current">1</span>
    </ul>
</nav>


  
                        </div>
                    </div>

                    <!-- sidebar -->
                    <div id="slidebar">
                        <div class="border-auto ps-2 pe-1 pb-2 pt-2">
    
        <!-- 侧边栏 分类 -->
<div class="card mb-3">
    <h6 class="card-header tag-hover"><i class="fa fa-folder-open pe-2"></i>分类
        
    </h6>
    <div class="card-body">
        <ul class="list-group border-0">
            
            
             
            <a class="list-group-item border-0 pt-0 pb-0 ps-1" href="/categories/QuickJS/ ">
                QuickJS <span class="badge bg-secondary float-end m-1">3</span>
            </a>
              
        </ul>

        <ul class="list-group border-0 collapse" id="category">
            
        </ul>
    </div>
</div>

 
    
        <!-- 侧边栏 标签 -->
<div class="card mb-3">
    <h6 class="card-header tag-hover"><i class="fa fa-tag pe-2"></i>标签
        
    </h6>

    <div class="card-body tag-hover">
        
        
             
            <a class="text-decoration-none border-0 d-inline-flex link-dark pt-0 pb-0 p-0" href="/tags/QuickJS/ ">
                QuickJS <span class="badge bg-secondary float-end m-1">6</span>
            </a>
          

        <span id="tags" class="collapse">
            
        </span>
    </div>
</div>
 
    
        <div class="card mb-3">
    <h6 class="card-header"><i class="fa fa-clock-o pe-2"></i>最近文章</h6>
    <div class="card-body tag-hover">
        <ul class="list-group border-0">
            
            
                <a class="list-group-item border-0 pt-0 pb-0 ps-1 fs-6" style="margin-bottom: 10px;" href="/2022/05/05/QuickJS-JSString-JSAtom/ ">
                    <small> QuickJS JSString&JSAtom </small>
                </a>
            
            
                <a class="list-group-item border-0 pt-0 pb-0 ps-1 fs-6" style="margin-bottom: 10px;" href="/2022/05/05/QuickJS%E5%AD%97%E8%8A%82%E7%A0%81%E6%89%93%E5%8D%B0/ ">
                    <small> QuickJS字节码打印 </small>
                </a>
            
            
                <a class="list-group-item border-0 pt-0 pb-0 ps-1 fs-6" style="margin-bottom: 10px;" href="/2022/05/05/QuickJS%E6%93%8D%E4%BD%9C%E7%A0%81/ ">
                    <small> QuickJS操作码 </small>
                </a>
            
            
                <a class="list-group-item border-0 pt-0 pb-0 ps-1 fs-6" style="margin-bottom: 10px;" href="/2022/05/12/QuickJS%E6%95%B0%E5%AD%97%E5%AD%97%E9%9D%A2%E9%87%8F/ ">
                    <small> QuickJS数字字面量 </small>
                </a>
            
            
                <a class="list-group-item border-0 pt-0 pb-0 ps-1 fs-6" style="margin-bottom: 10px;" href="/2022/05/16/QuickJS-JavaScript%E4%B8%96%E7%95%8C%E7%9A%84%E5%8E%9F%E5%A7%8B%E5%8E%9F%E5%9E%8B%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%BB%BA%E7%AB%8B/ ">
                    <small> QuickJS JavaScript世界的原始原型对象的建立 </small>
                </a>
            
             
        </ul>
    </div>
</div> 
    
        <div class="card mb-3">
    <h6 class="card-header"><i class="fa fa-link pe-2"></i>友情链接</h6>
    <div class="card-body tag-hover">
        <ul class="list-group border-0">
            
                <a class="list-group-item border-0 pt-0 pb-0 ps-1 fs-6 text" target="_blank" rel="noopener" href="https://blog.csdn.net/jayyuz ">
                    <small>CSDN</small>
                </a>
            
                <a class="list-group-item border-0 pt-0 pb-0 ps-1 fs-6 text" target="_blank" rel="noopener" href="https://smartlink.xin ">
                    <small>Smartlink</small>
                </a>
             
        </ul>
    </div>
</div> 
    
</div>
                    </div>
                </div>
            </main>


            <!-- footer -->
            <footer id="footer" class="bg-dark pt-3 pb-0 mt-5">
    <div class="container pb-4 pt-4 text-center">
        <p class="text-muted tag-hover"> Copyright © 2022 <a class="link-secondary text-decoration-none" target="_blank" rel="noopener" href="https://hexo.io"> SmartLink </a><br> <a class="link-secondary text-decoration-none" target="_blank" rel="noopener" href="https://github.com/smile-yan/hexo-theme-heyan"> Hexo </a> Theme <a class="link-secondary text-decoration-none" target="_blank" rel="noopener" href="https://github.com/smile-yan/hexo-theme-heyan"> heyan </a> 
            <br>
            <a class="link-secondary text-decoration-none" target="_blank" rel="noopener" href="https://beian.miit.gov.cn/#/Integrated/index">
                 
            </a>
        </p>
    </div>
</footer>
    <!-- hexo injector body_end start -->
<script src="/assets/prism-bundle.js"></script>
<script src="/assets/prism-plus.js" data-pjax=""></script>
<!-- hexo injector body_end end --><!-- hexo-inject:begin --><!-- hexo-inject:end --></body>
    <script>
        // 获取屏幕高度 document.documentElement.clientHeight
        console.log(document.documentElement.clientHeight);
        // 获取屏幕宽度 document.documentElement.clientWidth
        console.log(document.documentElement.clientWidth);
        if (document.documentElement.clientHeight > document.documentElement.clientWidth) {
            console.log('remove slidebar')
            document.getElementById("slidebar").remove()
            document.getElementById("content").className = "col-md-12";//单个class  
        } else {
            document.getElementById("slidebar").className = "col-md-2";//单个class  
            document.getElementById("content").className = "col-md-10";//单个class  
        }
    </script>
    <!-- https://cdn.jsdelivr.net/npm/vanta@0.5.22/dist/vanta.birds.min.js -->
    <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r121/three.min.js"></script> -->
    <!-- <script src="https://cdn.jsdelivr.net/npm/vanta@0.5.22/dist/vanta.dots.min.js"></script>
    <script>
        VANTA.DOTS({
            el: "#footer",
            mouseControls: true,
            touchControls: true,
            gyroControls: false,
            minHeight: 200.00,
            minWidth: 200.00,
            scale: 1.00,
            scaleMobile: 1.00,
            size: 2.20,
            spacing: 13.00
        })
    </script> -->

    <!-- <script src="https://cdn.jsdelivr.net/npm/vanta@0.5.22/dist/vanta.clouds2.min.js"></script>
    <script>
        VANTA.CLOUDS2({
            el: "#footer",
            mouseControls: true,
            touchControls: true,
            gyroControls: false,
            minHeight: 200.00,
            minWidth: 200.00,
            scale: 1.00,
            speed: 2.10,
            texturePath: "https://www.vantajs.com/gallery/noise.png"
        })
    </script> -->

</html>